package cn.ezios.huo.system.dao.service.impl;

import cn.ezios.huo.system.dao.domain.SysMenu;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ezios.huo.system.dao.service.SysMenuService;
import cn.ezios.huo.system.dao.mapper.SysMenuMapper;
import org.springframework.stereotype.Service;

/**
* @author 王坚
* @description 针对表【sys_menu(系统菜单)】的数据库操作Service实现
* @createDate 2024-07-17 09:49:16
*/
@Service
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu>
    implements SysMenuService{

    /**
     * 复制菜单
     *
     * @param id
     * @return
     */
    @Override
    public boolean copyMenu(String id) {
        SysMenu menu = getById(id);
        if(menu == null){
            return false;
        }
        menu.setMenuId(null);
        menu.setMenuName(menu.getMenuName() + "_copy");
        return save(menu);
    }
}




